<template>
  <div class="main-layout">
    <div class="main-top-lay">
      <Header style="flex:1;" :headHei='60'
              :title="systemTitle"
              :logo="logo" :user="userInfo" ref="headerRef"/>
    </div>
    <div class="main-content">
      <LeftNav style="height: 100%;" :headWid="100" :menus="menus" ref="headerRef"/>
      <div class="main-router-lay">
        <div class="main-router">
          <RouterView/>
        </div>
        <PageFooter/>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">

import Header from "@/components/common/PageHeader.vue";
import LeftNav from "@/components/common/PageLeftNav.vue";
import {useStore} from "@/stores";
import {computed, onMounted, ref, shallowRef} from "vue";
import PageFooter from "@/components/common/PageFooter.vue";

const logo = 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg';

const store = useStore();
const systemTitle = shallowRef('统一认证中心');
let headerRef = shallowRef(null);
let menus = ref<MenuType[]>(store.getTopMenus() || []);

const userInfo = computed(() => {
  return  store.getUser();
});

onMounted(() => {

})

</script>

<style scoped>
.main-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-top-lay {
  width: 100%;
  display: flex;
  flex-direction: row;
}

.main-content {
  display: flex;
  flex-direction: row;
  flex: 1;
}

.main-router-lay {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.main-router {
  flex: 1;
}

</style>
